<%-- 
    Document   : myAdverteerder_MainPage.jsp
    Created on : 8-mei-2012, 20:14:27
    Author     : Niels Leguit <niels.leguit at hva.nl>
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="tl" tagdir="/WEB-INF/tags/" %>

<html>
    <body> 
        <div class="post">
            <h2 class="title">Huidige advertenties</h2>
            <div class="story">

                <c:choose>
                    <c:when test="${aantalAdvertenties > 0}">
                        <table>
                            <tr>
                                <th align="left" width="15%"><b>Plaatsing</b></th>
                                <th align="left" width="20%"><b>tekst</b></th>
                                <th align="left" width="20%"><b>website</b></th>
                                <th align="left" width="20%"><b>getoond in</b></th>
                                <th align="left" width="5%"><b>views</b></th>
                                <th width="5%"></th>
                                <th width="5%"></th>
                            </tr>
                            <c:forEach var="tempAdv" items="${advertenties}" varStatus="loop">
                                <tr class="${loop.index % 2 == 0 ? 'even' : 'odd'}">                                  
                                    <td>${tempAdv.advDatum}</td>
                                    <td>${tempAdv.advAltTekst}</td>
                                    <td>${tempAdv.advWebsite}</td>
                                    <td>${tempAdv.advProvincie}</td>
                                    <td>${tempAdv.advNrOfViews}</td>
                                    <td><a href="AdvertentieEdit?advId=${tempAdv.advId}&del=false"><tl:editIcon /></a></td>
                                    <td><a href="AdvertentieToevoegen?advId=${tempAdv.advId}&del=true"><tl:delIcon /></a></td>
                                </tr>
                            </c:forEach>
                        </table>
                    </c:when>
                    <c:otherwise>
                        <b>Op dit moment heb je geen actieve advertenties</b>
                    </c:otherwise>
                </c:choose>    
            </div>
        </div>
    </body>
</html>


